<?php


namespace app\admin\controllers;


use app\admin\services\AuthService;
use app\BaseController;
use app\Request;

class AuthController extends BaseController
{
    private $authService;

    public function __construct(AuthService $authService)
    {
        $this->authService = $authService;
    }

    public function login(Request $request)
    {
        $result = $this->authService->login($request);
        return $this->success($result);
    }

    public function logout()
    {
        $result = $this->authService->logout();
        return $this->success($result);
    }

    public function me()
    {
        $result = $this->authService->me();
        return $this->success($result);
    }
}
